{include file="../application/admin/view/header.html" /}
</head>
<body>
<div class="container">
	<div class="col-md-12">
		<div class="alert kesn_prompt"></div>
	</div>
<div class="row">
	<form class="form-horizontal">
  <div class="form-group">
    <label for="domain_name" class="col-sm-2 control-label">域名</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="domain_name" placeholder="" value="{$web.domain_name}">
    </div>
  </div>
  <div class="form-group">
    <label for="ip" class="col-sm-2 control-label">IP</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="ip" placeholder="" value="{$web.ip}">
    </div>
  </div>
 
  
</form>
 <button class="btn btn-success save_web">保存</button>
</div>
</div>

{include file="../application/admin/view/footer.html" /}
<script type="text/javascript">
$('.save_web').click(function(){
	var domain_name = $('input#domain_name').val();
	var ip = $('input#ip').val();
	$.ajax({
			url : 'save_web',
			async:true,
			type:'POST',
			data:{
				domain_name :domain_name,
				ip:ip
			},
			dataType:'JSON',
			success:function(data,textStatus,jqXHR){
    				console.log(data);
    				if (data.err != 0) {
    					kesn_prompt('fail',data.content);
    				}else if (data.err == 0) {
                        kesn_prompt('success',data.content);   
                    }

    			},
    			error:function(){
    				kesn_prompt('fail','网络出错');
    			}
		});

});
</script>
</footer>
</body>
</html>